home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10984 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: news.sinet.slb.com!usenet
  2. From: "Vinh D. Nguyen" <vnguyen@sugar-land.anadrill.slb.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: BC++ Inheritance Question...
  5. Date: Mon, 11 Mar 1996 18:18:03 -0600
  6. Organization: Schlumberger Anadrill
  7. Message-ID: <3144C2BB.3532@sugar-land.anadrill.slb.com>
  8. References: <311D9DBE.9E5@iglou.com> <DMoyDs.3wL@news.arco.com> <3120CFB8.3CB@iglou.com> <4fr595$fra@qualcomm.com>
  9. NNTP-Posting-Host: 163.185.118.40
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (WinNT; I)
  14.  
  15. Nasser Abbasi wrote:
  16. > In article <3120CFB8.3CB@iglou.com>, panther@iglou.com says...
  17. > >So let me get this straight...
  18. > >
  19. > >        In public inheitance, public members stay public, protected
  20. > members stay
  21. > >protected, and private members stay private in the in the derived class.
  22. > close but no sigar.
  23. > in private inheritance, public and protected members of base class
  24. > become private in derived class, but private members of base class
  25. > stay private members to the base class.
  26. > Nasser
  27.  
  28. I would also like to add that the inheritance protection mechanism is
  29. reversible. That is, if a public member in a parent class, or for that
  30. matter any ancestor classes, becomes protected or private through protected
  31. or private inheritance somewhere along the inheritance chain, the member can 
  32. be made public again by declaring it as so in the derived class using the
  33. Parent_Class::Member syntax.
  34.  
  35. -- 
  36. --------------------------------------------------------------------------
  37. * Vinh Nguyen                                            vnguyen@slb.com *
  38. * Drilling Information Products - Senior Engineer             *
  39. * Anadrill Schlumberger                                        *
  40. * 200 Gillingham Ln.                             (713) 275-7524 (Office) *
  41. * Sugarland, TX 77478                            (713) 275-8098 (FAX)    *
  42. --------------------------------------------------------------------------
  43.